//
//  AmountView.swift
//  LiteAccount
//
//  Created by 刘伟 on 2017/5/19.
//  Copyright © 2017年 刘伟. All rights reserved.
//

import UIKit

class AmountView: UIView {
    
    var amount: Double? {
        didSet {
            if amount != nil {
                amountLabel.text = String(format: "%.2f", amount!)
            }
        }
    }

    override init(frame: CGRect) {
        super.init(frame: .zero)
        self.backgroundColor = UIColor.la_app
        self.addSubview(amountLabel)
        amountLabel.snp.makeConstraints { (make) in
            make.center.equalToSuperview()
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    lazy var amountLabel: UILabel = {
        let object = UILabel()
        object.textColor = .white
        object.font = UIFont.la_Font(ofSize: 60)
        object.textAlignment = .center
        object.text = "0.00"
        return object
    }()
    
}
